import ReactDOM from 'react-dom'
import React, { Component } from 'react'


// 父组件
class Parent extends Component {
  state = {
    money: 10000
  }
  render() {
    return (
      <div>
        父组件：{this.state.money}
        <Child money={this.state.money} />
      </div>
    )
  }
}

// 子组件
const Child = (props) => {
  return <div>子组件：{props.money}</div>
}


// 根组件
class App extends Component {
  render() {
    return (
      <>
       <Parent />
      </>
    )
  }
}

ReactDOM.render(<App />, document.getElementById('root'))